<template>
  <div class="header">
    <div class="header-content">
      <h1 class="title">
        <span class="icon">🌍</span>
        全球地震实时监控
      </h1>
      <div class="stats">
        <div class="stat-item">
          <span class="stat-label">24小时内地震数量</span>
          <span class="stat-value">{{ earthquakeCount || '加载中...' }}</span>
        </div>
        <div class="stat-item">
          <span class="stat-label">最大震级</span>
          <span class="stat-value">{{ maxMagnitude > 0 ? `M ${maxMagnitude.toFixed(1)}` : '-' }}</span>
        </div>
        <div class="stat-item">
          <span class="stat-label">最后更新</span>
          <span class="stat-value">{{ lastUpdate || '-' }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HeaderStats',
  props: {
    earthquakeCount: {
      type: Number,
      default: 0
    },
    maxMagnitude: {
      type: Number,
      default: 0
    },
    lastUpdate: {
      type: String,
      default: ''
    }
  }
}
</script>

<style scoped>
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .stats {
        gap: 1rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}
</style>
</write_to_file>